<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateMachinesTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('machines', function (Blueprint $table) {
            $table->bigIncrements('id');
            $table->string('name', 20)->default('')->comment('设备名称');
            $table->string('imei', 50)->default('')->comment('imei编号');
            $table->string('sim_no', 15)->default('')->comment('sim卡号');
            $table->bigInteger('mainborad_id')->default(0)->comment('货道ID');
            $table->json('config')->comment('配置数据');
            $table->tinyInteger('state')->default(1)->comment('设备状态1正常2关闭');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('machines');
    }
}
